// eslint-disable-next-line
import { UserLayout, BasicLayout, BlankLayout, RouteView } from '@/layouts'

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/auth',
    component: UserLayout,
    redirect: '/auth/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/auth/Login')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },

  // account
  {
    path: '/account',
    component: BasicLayout,
    redirect: '/account/center',
    name: 'account',
    meta: { title: 'menu.account', icon: 'user', keepAlive: false, permission: ['user'] },
    children: [
      {
        path: '/account/center',
        name: 'center',
        component: () => import('@/views/account/center'),
        meta: { title: 'menu.account.center', keepAlive: false, permission: ['user'] }
      },
      {
        path: '/account/settings',
        name: 'settings',
        component: () => import('@/views/account/settings/Index'),
        meta: { title: 'menu.account.settings', hideHeader: true, permission: ['user'] },
        redirect: '/account/settings/basic',
        hideChildrenInMenu: true,
        children: [
          {
            path: '/account/settings/basic',
            name: 'BasicSettings',
            component: () => import('@/views/account/settings/BasicSetting'),
            meta: { title: 'account.settings.menuMap.basic', hidden: true, permission: ['user'] }
          },
          {
            path: '/account/settings/security',
            name: 'SecuritySettings',
            component: () => import('@/views/account/settings/Security'),
            meta: {
              title: 'account.settings.menuMap.security',
              hidden: true,
              keepAlive: false,
              permission: ['user']
            }
          }
        ]
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  },
  {
    path: '/network-error',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/network-error')
  }
]
